package com.yuzhihao.writejvm.code;

import lombok.Data;

/**
 * 运行指令抽象
 * 执行指令的操作符号集操作数
 *
 * @author yzh
 * @since 2021年12月15日14:07:22
 * @see <a href ="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-6.html#jvms-6.5">jvmdoc</a>
 */
@Data
public abstract class Operation{

    public final static int tag_u1 = 1;

    protected int index;

    /**
     * 执行指令
     * @param frame
     * @return
     */
    public abstract StackFrame exec(StackFrame frame);

    public String print(String print){
        return "";
    }
}
